package com.ypc.webdemo.controller;

import com.ypc.webdemo.controller.dto.ServerResult;
import com.ypc.webdemo.service.RemoteControlService;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author yinpengcheng
 * @Date 2023/7/21
 */
@Api(tags = "遥控器")
@RestController
@RequestMapping("remoteControl")
public class RemoteControlController {
    @Resource
    private RemoteControlService remoteControlService;

    @PostMapping("open")
    protected ServerResult open() {
        remoteControlService.open();
        return ServerResult.success();
    }
    @PostMapping("close")
    protected ServerResult close() {
        remoteControlService.close();
        return ServerResult.success();
    }
}
